package xixirupan.tmgp.tencent.com.vmeim.ui.shopcar.view;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import xixirupan.tmgp.tencent.com.vmeim.R;
import xixirupan.tmgp.tencent.com.vmeim.ui.shopcar.presenter.ShopCarPresenter;

/**
 * Created by lenovo on 2016/10/18.
 */

public class ShopCarFragment extends Fragment {

    private Context context;
    @BindView(R.id.zhan)
    View zhan;
    @BindView(R.id.goshopping_shopcar)
    TextView goshoppingShopcar;
    @BindView(R.id.recyclerView_shopcar)
    RecyclerView recyclerViewShopcar;
    private  Unbinder bind;
    ShopCarPresenter presenter;

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        this.context =context;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_shopcar_layout, container, false);
         bind = ButterKnife.bind(this, view);
        presenter =new ShopCarPresenter(context,inflater,recyclerViewShopcar);
        presenter.getShopCarData();
        return view;
    }

    @OnClick(R.id.goshopping_shopcar)
    public void onClick() {
        //回退按钮
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        bind.unbind();
    }
}
